Angular JS Interview Questions and Answers
Question: How will you add options to a select box?Answer:Using the ng-options and ng-model directives. <fieldset> <dl class="control-group"> <dt> <label for="cientId"> <h4>Client Id:</h4> </label> </dt> <dd> <select id="cientId" class="input-xlarge" ng-model="clientId" ng-options="reportClient.clientId as reportClient.clientId for reportClient in reportClients " ng-click="getReportParams()" ng-change="getValuationDates()" /> </dd> </dl> <dl class="control-group"> <dt> <label for="valuationDate"> <h4> Valuation Date <small>(dd/mm/yyyy)</small> </h4> </label> </dt> <dd> <select id="valuationDate" class="input-xlarge" ng-model="valuationDate" ng-options="reportdate for reportdate in reportDates" /> </dd> </dl> </fieldset> |
Is it helpful?
Yes
No
Most helpful rated by users:
- What is AngularJS?
- Tell me does Angular use the jQuery library?
- Tell me can we use the open-source Closure Library with Angular?
- Why is this project called "AngularJS"? Why is the namespace called "ng"?
- Can you please explain what is testability like in Angular?